package ru.ifmo.common.util;

import java.util.LinkedList;
import java.util.List;

/**
 * @author avhaliullin
 */
public class StringUtil {
    public static LinkedList<Character> getListByString(String s) {
        LinkedList<Character> res = new LinkedList<Character>();
        for (int i = 0; i < s.length(); i++) {
            res.add(s.charAt(i));
        }
        return res;
    }

    public static String getStringByList(List<Character> s) {
        char[] data = new char[s.size()];
        int i = 0;
        for (Character c : s) {
            data[i++] = c;
        }
        return new String(data);
    }
}
